package cn.wostore.wxhelper.Xposed;

import android.view.View;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;

/**
 * @author wuch
 * @date 2018/12/21 0021
 */
public class AddMenuItemHook extends XC_MethodHook {
    private final LoadHook loadHook;

    AddMenuItemHook(LoadHook loadHook) {
        this.loadHook = loadHook;
    }

    @Override
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {
        super.beforeHookedMethod(param);
        XposedHelpers.setObjectField(param.thisObject, "npl",
                new MyContextMenuListener(this.loadHook, (View.OnCreateContextMenuListener) XposedHelpers.getObjectField(param.thisObject, "npl"), param));
        Object object = XposedHelpers.getObjectField(param.thisObject, "vko");
        //this.loadHook.a();
    }
}
